<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>高频考点 | 前端档案</title>
    <meta name="generator" content="VuePress 1.8.2">
    <link rel="icon" href="/favicon.ico">
    <meta name="description" content="前端通关宝典">
    <meta name="theme-color" content="#3eaf7c">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    
    <link rel="preload" href="/assets/css/0.styles.e02fc531.css" as="style"><link rel="preload" href="/assets/js/app.bf44e39b.js" as="script"><link rel="preload" href="/assets/js/2.db7a59af.js" as="script"><link rel="preload" href="/assets/js/268.2bdd86cb.js" as="script"><link rel="prefetch" href="/assets/js/10.3bbe2f24.js"><link rel="prefetch" href="/assets/js/100.43061c81.js"><link rel="prefetch" href="/assets/js/101.2e8a188c.js"><link rel="prefetch" href="/assets/js/102.3f4f14f0.js"><link rel="prefetch" href="/assets/js/103.5ed45f48.js"><link rel="prefetch" href="/assets/js/104.29ef9283.js"><link rel="prefetch" href="/assets/js/105.e4051d70.js"><link rel="prefetch" href="/assets/js/106.ec073f00.js"><link rel="prefetch" href="/assets/js/107.9b165150.js"><link rel="prefetch" href="/assets/js/108.c0031864.js"><link rel="prefetch" href="/assets/js/109.06bb75a7.js"><link rel="prefetch" href="/assets/js/11.402e3434.js"><link rel="prefetch" href="/assets/js/110.edc92528.js"><link rel="prefetch" href="/assets/js/111.e50e0cca.js"><link rel="prefetch" href="/assets/js/112.b0decdf4.js"><link rel="prefetch" href="/assets/js/113.f0801886.js"><link rel="prefetch" href="/assets/js/114.25ab8fa4.js"><link rel="prefetch" href="/assets/js/115.36fc62f3.js"><link rel="prefetch" href="/assets/js/116.8df9a6aa.js"><link rel="prefetch" href="/assets/js/117.1ec0fada.js"><link rel="prefetch" href="/assets/js/118.51c54869.js"><link rel="prefetch" href="/assets/js/119.d708669d.js"><link rel="prefetch" href="/assets/js/12.eba9a66a.js"><link rel="prefetch" href="/assets/js/120.a44efeea.js"><link rel="prefetch" href="/assets/js/121.581a4ae4.js"><link rel="prefetch" href="/assets/js/122.e54e19e1.js"><link rel="prefetch" href="/assets/js/123.62aa41d0.js"><link rel="prefetch" href="/assets/js/124.c51c6b7f.js"><link rel="prefetch" href="/assets/js/125.68055811.js"><link rel="prefetch" href="/assets/js/126.8b16d246.js"><link rel="prefetch" href="/assets/js/127.fc7608d6.js"><link rel="prefetch" href="/assets/js/128.0df431fc.js"><link rel="prefetch" href="/assets/js/129.77241cfd.js"><link rel="prefetch" href="/assets/js/13.a3e65817.js"><link rel="prefetch" href="/assets/js/130.2bf0b622.js"><link rel="prefetch" href="/assets/js/131.77da1093.js"><link rel="prefetch" href="/assets/js/132.c1ac84bc.js"><link rel="prefetch" href="/assets/js/133.001af559.js"><link rel="prefetch" href="/assets/js/134.98ff69db.js"><link rel="prefetch" href="/assets/js/135.b91963f4.js"><link rel="prefetch" href="/assets/js/136.e3df531a.js"><link rel="prefetch" href="/assets/js/137.157c5a5f.js"><link rel="prefetch" href="/assets/js/138.1d3a1791.js"><link rel="prefetch" href="/assets/js/139.9e17df54.js"><link rel="prefetch" href="/assets/js/14.bd9cc5f8.js"><link rel="prefetch" href="/assets/js/140.22839840.js"><link rel="prefetch" href="/assets/js/141.dbde614d.js"><link rel="prefetch" href="/assets/js/142.5a6858ba.js"><link rel="prefetch" href="/assets/js/143.e26d707c.js"><link rel="prefetch" href="/assets/js/144.5b1fbe13.js"><link rel="prefetch" href="/assets/js/145.09921e20.js"><link rel="prefetch" href="/assets/js/146.8ea606b7.js"><link rel="prefetch" href="/assets/js/147.41bda9d5.js"><link rel="prefetch" href="/assets/js/148.d89f18bc.js"><link rel="prefetch" href="/assets/js/149.16aa39c9.js"><link rel="prefetch" href="/assets/js/15.deb2f25a.js"><link rel="prefetch" href="/assets/js/150.07798494.js"><link rel="prefetch" href="/assets/js/151.6732ee94.js"><link rel="prefetch" href="/assets/js/152.c644167e.js"><link rel="prefetch" href="/assets/js/153.040f256b.js"><link rel="prefetch" href="/assets/js/154.1cec3035.js"><link rel="prefetch" href="/assets/js/155.a4b51a17.js"><link rel="prefetch" href="/assets/js/156.095b78e0.js"><link rel="prefetch" href="/assets/js/157.eb262a26.js"><link rel="prefetch" href="/assets/js/158.35756e8c.js"><link rel="prefetch" href="/assets/js/159.6ac43664.js"><link rel="prefetch" href="/assets/js/16.c7b17381.js"><link rel="prefetch" href="/assets/js/160.0a56c40c.js"><link rel="prefetch" href="/assets/js/161.8320b48a.js"><link rel="prefetch" href="/assets/js/162.09ba1172.js"><link rel="prefetch" href="/assets/js/163.f7fb82e8.js"><link rel="prefetch" href="/assets/js/164.ab9df42b.js"><link rel="prefetch" href="/assets/js/165.f012858f.js"><link rel="prefetch" href="/assets/js/166.b3f190e3.js"><link rel="prefetch" href="/assets/js/167.43b66e59.js"><link rel="prefetch" href="/assets/js/168.4eb162d3.js"><link rel="prefetch" href="/assets/js/169.0375d2cf.js"><link rel="prefetch" href="/assets/js/17.da61c942.js"><link rel="prefetch" href="/assets/js/170.90c9c235.js"><link rel="prefetch" href="/assets/js/171.672fc257.js"><link rel="prefetch" href="/assets/js/172.dfa9d8d9.js"><link rel="prefetch" href="/assets/js/173.61a6ec8e.js"><link rel="prefetch" href="/assets/js/174.4f4ef0d7.js"><link rel="prefetch" href="/assets/js/175.675d01d1.js"><link rel="prefetch" href="/assets/js/176.5bd1bcb7.js"><link rel="prefetch" href="/assets/js/177.4355dadd.js"><link rel="prefetch" href="/assets/js/178.79ed29b8.js"><link rel="prefetch" href="/assets/js/179.2247dc30.js"><link rel="prefetch" href="/assets/js/18.6e554767.js"><link rel="prefetch" href="/assets/js/180.db79361a.js"><link rel="prefetch" href="/assets/js/181.85a33295.js"><link rel="prefetch" href="/assets/js/182.0bc317bc.js"><link rel="prefetch" href="/assets/js/183.7769a38e.js"><link rel="prefetch" href="/assets/js/184.9b0aba05.js"><link rel="prefetch" href="/assets/js/185.f6dc87bd.js"><link rel="prefetch" href="/assets/js/186.e3b7de00.js"><link rel="prefetch" href="/assets/js/187.a6dadcea.js"><link rel="prefetch" href="/assets/js/188.d3f8b0e3.js"><link rel="prefetch" href="/assets/js/189.1112499f.js"><link rel="prefetch" href="/assets/js/19.f800e0d1.js"><link rel="prefetch" href="/assets/js/190.e3255e84.js"><link rel="prefetch" href="/assets/js/191.34deece6.js"><link rel="prefetch" href="/assets/js/192.69821c0e.js"><link rel="prefetch" href="/assets/js/193.769a5088.js"><link rel="prefetch" href="/assets/js/194.afaa2cde.js"><link rel="prefetch" href="/assets/js/195.5b94bbc6.js"><link rel="prefetch" href="/assets/js/196.3b078264.js"><link rel="prefetch" href="/assets/js/197.2d9585d3.js"><link rel="prefetch" href="/assets/js/198.3095d8b8.js"><link rel="prefetch" href="/assets/js/199.79b6db11.js"><link rel="prefetch" href="/assets/js/20.4a74a968.js"><link rel="prefetch" href="/assets/js/200.c309ef7a.js"><link rel="prefetch" href="/assets/js/201.bded46e8.js"><link rel="prefetch" href="/assets/js/202.801fb3ea.js"><link rel="prefetch" href="/assets/js/203.b9933f5e.js"><link rel="prefetch" href="/assets/js/204.255b43df.js"><link rel="prefetch" href="/assets/js/205.000fb7ac.js"><link rel="prefetch" href="/assets/js/206.8f945829.js"><link rel="prefetch" href="/assets/js/207.74942b2e.js"><link rel="prefetch" href="/assets/js/208.329d8230.js"><link rel="prefetch" href="/assets/js/209.3fc54586.js"><link rel="prefetch" href="/assets/js/21.5f725cbd.js"><link rel="prefetch" href="/assets/js/210.1aa9659f.js"><link rel="prefetch" href="/assets/js/211.702df03f.js"><link rel="prefetch" href="/assets/js/212.ca95f208.js"><link rel="prefetch" href="/assets/js/213.024b4fa6.js"><link rel="prefetch" href="/assets/js/214.e2830dd8.js"><link rel="prefetch" href="/assets/js/215.0b646cb4.js"><link rel="prefetch" href="/assets/js/216.9bd6d019.js"><link rel="prefetch" href="/assets/js/217.586593b4.js"><link rel="prefetch" href="/assets/js/218.a2244829.js"><link rel="prefetch" href="/assets/js/219.1d858220.js"><link rel="prefetch" href="/assets/js/22.7d2b7a74.js"><link rel="prefetch" href="/assets/js/220.7f5e3dbd.js"><link rel="prefetch" href="/assets/js/221.d1f79d31.js"><link rel="prefetch" href="/assets/js/222.51d8a12c.js"><link rel="prefetch" href="/assets/js/223.797028ea.js"><link rel="prefetch" href="/assets/js/224.d925bf8b.js"><link rel="prefetch" href="/assets/js/225.cfe12606.js"><link rel="prefetch" href="/assets/js/226.b6bd41b4.js"><link rel="prefetch" href="/assets/js/227.15412d16.js"><link rel="prefetch" href="/assets/js/228.66af5157.js"><link rel="prefetch" href="/assets/js/229.cfb11559.js"><link rel="prefetch" href="/assets/js/23.1409c9f4.js"><link rel="prefetch" href="/assets/js/230.d2e613b5.js"><link rel="prefetch" href="/assets/js/231.85b8958b.js"><link rel="prefetch" href="/assets/js/232.42df48c8.js"><link rel="prefetch" href="/assets/js/233.d3be0c78.js"><link rel="prefetch" href="/assets/js/234.bb68d0be.js"><link rel="prefetch" href="/assets/js/235.bfd00052.js"><link rel="prefetch" href="/assets/js/236.3d58cc9d.js"><link rel="prefetch" href="/assets/js/237.d9af6062.js"><link rel="prefetch" href="/assets/js/238.54894974.js"><link rel="prefetch" href="/assets/js/239.b69669d0.js"><link rel="prefetch" href="/assets/js/24.e06b2b32.js"><link rel="prefetch" href="/assets/js/240.44f7b333.js"><link rel="prefetch" href="/assets/js/241.2d307b1a.js"><link rel="prefetch" href="/assets/js/242.47aecf42.js"><link rel="prefetch" href="/assets/js/243.b5afbb6e.js"><link rel="prefetch" href="/assets/js/244.8e04094f.js"><link rel="prefetch" href="/assets/js/245.78009475.js"><link rel="prefetch" href="/assets/js/246.eb7991c2.js"><link rel="prefetch" href="/assets/js/247.00c024fd.js"><link rel="prefetch" href="/assets/js/248.144c2842.js"><link rel="prefetch" href="/assets/js/249.35bae652.js"><link rel="prefetch" href="/assets/js/25.5e7aeaa8.js"><link rel="prefetch" href="/assets/js/250.854bde18.js"><link rel="prefetch" href="/assets/js/251.7cbb77f8.js"><link rel="prefetch" href="/assets/js/252.1ed96448.js"><link rel="prefetch" href="/assets/js/253.9d736b7d.js"><link rel="prefetch" href="/assets/js/254.137c6595.js"><link rel="prefetch" href="/assets/js/255.ac6865dc.js"><link rel="prefetch" href="/assets/js/256.055e06fd.js"><link rel="prefetch" href="/assets/js/257.63559614.js"><link rel="prefetch" href="/assets/js/258.b6958ba1.js"><link rel="prefetch" href="/assets/js/259.bc6da491.js"><link rel="prefetch" href="/assets/js/26.77d42111.js"><link rel="prefetch" href="/assets/js/260.a8e9559d.js"><link rel="prefetch" href="/assets/js/261.b051c6dd.js"><link rel="prefetch" href="/assets/js/262.e83c7ca8.js"><link rel="prefetch" href="/assets/js/263.bd14a165.js"><link rel="prefetch" href="/assets/js/264.65c3b624.js"><link rel="prefetch" href="/assets/js/265.db4371b9.js"><link rel="prefetch" href="/assets/js/266.97118d6c.js"><link rel="prefetch" href="/assets/js/267.de83cb0b.js"><link rel="prefetch" href="/assets/js/269.9c9a802f.js"><link rel="prefetch" href="/assets/js/27.fa37605f.js"><link rel="prefetch" href="/assets/js/270.f599f9fe.js"><link rel="prefetch" href="/assets/js/271.275d4619.js"><link rel="prefetch" href="/assets/js/272.ed0fabf6.js"><link rel="prefetch" href="/assets/js/273.fc279fbe.js"><link rel="prefetch" href="/assets/js/274.fe4b3d21.js"><link rel="prefetch" href="/assets/js/275.922677e1.js"><link rel="prefetch" href="/assets/js/276.597ceb81.js"><link rel="prefetch" href="/assets/js/277.71871d2e.js"><link rel="prefetch" href="/assets/js/278.10923657.js"><link rel="prefetch" href="/assets/js/279.cddbf2d7.js"><link rel="prefetch" href="/assets/js/28.7418a003.js"><link rel="prefetch" href="/assets/js/280.66542c64.js"><link rel="prefetch" href="/assets/js/281.c7ca5292.js"><link rel="prefetch" href="/assets/js/282.d105ef08.js"><link rel="prefetch" href="/assets/js/283.ae8d69c7.js"><link rel="prefetch" href="/assets/js/284.8763c337.js"><link rel="prefetch" href="/assets/js/285.cce4e007.js"><link rel="prefetch" href="/assets/js/29.42b5bf54.js"><link rel="prefetch" href="/assets/js/3.a2af090e.js"><link rel="prefetch" href="/assets/js/30.7fe0ece5.js"><link rel="prefetch" href="/assets/js/31.e05d012e.js"><link rel="prefetch" href="/assets/js/32.0a6466c6.js"><link rel="prefetch" href="/assets/js/33.8db270b1.js"><link rel="prefetch" href="/assets/js/34.c6e6ae70.js"><link rel="prefetch" href="/assets/js/35.8fc12d56.js"><link rel="prefetch" href="/assets/js/36.cb54baf3.js"><link rel="prefetch" href="/assets/js/37.656cb8eb.js"><link rel="prefetch" href="/assets/js/38.9152ff6b.js"><link rel="prefetch" href="/assets/js/39.f71e5e3d.js"><link rel="prefetch" href="/assets/js/4.02de3c47.js"><link rel="prefetch" href="/assets/js/40.3d664ab4.js"><link rel="prefetch" href="/assets/js/41.fc6e4f78.js"><link rel="prefetch" href="/assets/js/42.c17c3353.js"><link rel="prefetch" href="/assets/js/43.e78a329f.js"><link rel="prefetch" href="/assets/js/44.326a0948.js"><link rel="prefetch" href="/assets/js/45.67e6e1d4.js"><link rel="prefetch" href="/assets/js/46.85f71b1e.js"><link rel="prefetch" href="/assets/js/47.f2e524a6.js"><link rel="prefetch" href="/assets/js/48.843108ee.js"><link rel="prefetch" href="/assets/js/49.98713c95.js"><link rel="prefetch" href="/assets/js/5.f38c3daa.js"><link rel="prefetch" href="/assets/js/50.2c70898f.js"><link rel="prefetch" href="/assets/js/51.023fea5d.js"><link rel="prefetch" href="/assets/js/52.3877af4c.js"><link rel="prefetch" href="/assets/js/53.3938d117.js"><link rel="prefetch" href="/assets/js/54.4cf45721.js"><link rel="prefetch" href="/assets/js/55.6894de94.js"><link rel="prefetch" href="/assets/js/56.48fd0f63.js"><link rel="prefetch" href="/assets/js/57.2c3b8155.js"><link rel="prefetch" href="/assets/js/58.fee976b4.js"><link rel="prefetch" href="/assets/js/59.d57c3ac9.js"><link rel="prefetch" href="/assets/js/6.a7d50f34.js"><link rel="prefetch" href="/assets/js/60.9954df49.js"><link rel="prefetch" href="/assets/js/61.1b870f60.js"><link rel="prefetch" href="/assets/js/62.37537ac3.js"><link rel="prefetch" href="/assets/js/63.5e7cfac8.js"><link rel="prefetch" href="/assets/js/64.407003ca.js"><link rel="prefetch" href="/assets/js/65.ba6c5d7d.js"><link rel="prefetch" href="/assets/js/66.2b5a751b.js"><link rel="prefetch" href="/assets/js/67.2faf15d0.js"><link rel="prefetch" href="/assets/js/68.19e50dcb.js"><link rel="prefetch" href="/assets/js/69.eec003cb.js"><link rel="prefetch" href="/assets/js/7.6c196c91.js"><link rel="prefetch" href="/assets/js/70.98d2461a.js"><link rel="prefetch" href="/assets/js/71.184225a4.js"><link rel="prefetch" href="/assets/js/72.956d136a.js"><link rel="prefetch" href="/assets/js/73.3e68378e.js"><link rel="prefetch" href="/assets/js/74.cec669e7.js"><link rel="prefetch" href="/assets/js/75.d418b5f0.js"><link rel="prefetch" href="/assets/js/76.f3f9ccd6.js"><link rel="prefetch" href="/assets/js/77.f24df03b.js"><link rel="prefetch" href="/assets/js/78.7eee67a8.js"><link rel="prefetch" href="/assets/js/79.8fadb3f7.js"><link rel="prefetch" href="/assets/js/8.b7eb2fb2.js"><link rel="prefetch" href="/assets/js/80.4f6165b0.js"><link rel="prefetch" href="/assets/js/81.49b03807.js"><link rel="prefetch" href="/assets/js/82.7ea07224.js"><link rel="prefetch" href="/assets/js/83.d6bd71b7.js"><link rel="prefetch" href="/assets/js/84.26db1aa8.js"><link rel="prefetch" href="/assets/js/85.c8f1f3bb.js"><link rel="prefetch" href="/assets/js/86.fd1c3c7f.js"><link rel="prefetch" href="/assets/js/87.38ab6ed9.js"><link rel="prefetch" href="/assets/js/88.f0a874e0.js"><link rel="prefetch" href="/assets/js/89.2b3352d4.js"><link rel="prefetch" href="/assets/js/9.d7ae4925.js"><link rel="prefetch" href="/assets/js/90.286cc7d4.js"><link rel="prefetch" href="/assets/js/91.c17c366b.js"><link rel="prefetch" href="/assets/js/92.29bc2389.js"><link rel="prefetch" href="/assets/js/93.6d335097.js"><link rel="prefetch" href="/assets/js/94.89ab26c7.js"><link rel="prefetch" href="/assets/js/95.f2493183.js"><link rel="prefetch" href="/assets/js/96.6662ec36.js"><link rel="prefetch" href="/assets/js/97.22c9d3f9.js"><link rel="prefetch" href="/assets/js/98.0b0b77a2.js"><link rel="prefetch" href="/assets/js/99.df5f5981.js">
    <link rel="stylesheet" href="/assets/css/0.styles.e02fc531.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/images/logo.png" alt="前端档案" class="logo"> <span class="site-name can-hide">前端档案</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/fe/" class="nav-link">
  前端
</a></div><div class="nav-item"><a href="/be/" class="nav-link">
  后端
</a></div><div class="nav-item"><a href="/base/" class="nav-link">
  基础
</a></div><div class="nav-item"><a href="/tools/" class="nav-link">
  工具
</a></div><div class="nav-item"><a href="/resume/" class="nav-link">
  简历
</a></div><div class="nav-item"><a href="/experience/" class="nav-link">
  面经
</a></div><div class="nav-item"><a href="/technology/" class="nav-link router-link-active">
  八股文
</a></div><div class="nav-item"><a href="/thinks/" class="nav-link">
  思考
</a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/fe/" class="nav-link">
  前端
</a></div><div class="nav-item"><a href="/be/" class="nav-link">
  后端
</a></div><div class="nav-item"><a href="/base/" class="nav-link">
  基础
</a></div><div class="nav-item"><a href="/tools/" class="nav-link">
  工具
</a></div><div class="nav-item"><a href="/resume/" class="nav-link">
  简历
</a></div><div class="nav-item"><a href="/experience/" class="nav-link">
  面经
</a></div><div class="nav-item"><a href="/technology/" class="nav-link router-link-active">
  八股文
</a></div><div class="nav-item"><a href="/thinks/" class="nav-link">
  思考
</a></div> <!----></nav>  <ul class="sidebar-links"><li><a href="/technology/" aria-current="page" class="sidebar-link">待整理部分</a></li><li><a href="/technology/excellent.html" aria-current="page" class="active sidebar-link">高频考点</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/technology/excellent.html#_1-typeof类型判断" class="sidebar-link">1 typeof类型判断</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_2-类型转换" class="sidebar-link">2 类型转换</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_3-this" class="sidebar-link">3 This</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_4-和-有什么区别" class="sidebar-link">4 == 和 === 有什么区别</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_5-闭包" class="sidebar-link">5 闭包</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_6-深浅拷贝" class="sidebar-link">6 深浅拷贝</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_7-原型" class="sidebar-link">7 原型</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_8-var、let-及-const-区别" class="sidebar-link">8 var、let 及 const 区别</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_9-原型继承和-class-继承" class="sidebar-link">9 原型继承和 Class 继承</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_10-模块化" class="sidebar-link">10 模块化</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_11-实现一个简洁版的promise" class="sidebar-link">11 实现一个简洁版的promise</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_12-event-loop" class="sidebar-link">12 Event Loop</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_13-手写-call、apply-及-bind-函数" class="sidebar-link">13 手写 call、apply 及 bind 函数</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_14-new" class="sidebar-link">14 new</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_15-instanceof-的原理" class="sidebar-link">15 instanceof 的原理</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_16-为什么-0-1-0-2-0-3" class="sidebar-link">16 为什么 0.1 + 0.2 != 0.3</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_17-事件机制" class="sidebar-link">17 事件机制</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_18-跨域" class="sidebar-link">18 跨域</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_19-存储" class="sidebar-link">19 存储</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_20-浏览器缓存机制" class="sidebar-link">20 浏览器缓存机制</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_21-浏览器渲染原理" class="sidebar-link">21 浏览器渲染原理</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_22-安全防范" class="sidebar-link">22 安全防范</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_23-从-v8-中看-js-性能优化" class="sidebar-link">23 从 V8 中看 JS 性能优化</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_24-性能优化" class="sidebar-link">24 性能优化</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_25-webpack-性能优化" class="sidebar-link">25 Webpack 性能优化</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_26-实现小型打包工具" class="sidebar-link">26 实现小型打包工具</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_27-mvvm-虚拟dom-前端路由" class="sidebar-link">27 MVVM/虚拟DOM/前端路由</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_28-vue常考知识点" class="sidebar-link">28 Vue常考知识点</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_29-react常考知识点" class="sidebar-link">29 React常考知识点</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_30-监控" class="sidebar-link">30 监控</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_30-1-页面埋点" class="sidebar-link">30.1 页面埋点</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_30-2-性能监控" class="sidebar-link">30.2 性能监控</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_30-3-异常监控" class="sidebar-link">30.3 异常监控</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_31-tcp-udp" class="sidebar-link">31 TCP/UDP</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_32-http-tls" class="sidebar-link">32 HTTP/TLS</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_33-http2-0" class="sidebar-link">33 HTTP2.0</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_34-设计模式" class="sidebar-link">34 设计模式</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_35-常见数据结构" class="sidebar-link">35 常见数据结构</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_36-常考算法题解析" class="sidebar-link">36 常考算法题解析</a></li><li class="sidebar-sub-header"><a href="/technology/excellent.html#_37-css常考面试题解析" class="sidebar-link">37 css常考面试题解析</a></li></ul></li><li><a href="/technology/js_higher.html" class="sidebar-link">JS高级知识点</a></li><li><a href="/technology/eight_001.html" class="sidebar-link">八股文-001</a></li><li><a href="/technology/eight_002.html" class="sidebar-link">八股文-002</a></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="高频考点"><a href="#高频考点" class="header-anchor">#</a> 高频考点</h1> <h2 id="_1-typeof类型判断"><a href="#_1-typeof类型判断" class="header-anchor">#</a> 1 typeof类型判断</h2> <blockquote><p><code>typeof</code> 是否能正确判断类型？<code>instanceof</code> 能正确判断对象的原理是什么</p></blockquote> <ul><li><code>typeof</code> 对于原始类型来说，除了 <code>null</code> 都可以显示正确的类型</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">typeof</span> <span class="token number">1</span> <span class="token comment">// 'number'</span>
<span class="token keyword">typeof</span> <span class="token string">'1'</span> <span class="token comment">// 'string'</span>
<span class="token keyword">typeof</span> <span class="token keyword">undefined</span> <span class="token comment">// 'undefined'</span>
<span class="token keyword">typeof</span> <span class="token boolean">true</span> <span class="token comment">// 'boolean'</span>
<span class="token keyword">typeof</span> <span class="token function">Symbol</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// 'symbol'</span>
</code></pre></div><blockquote><p><code>typeof</code> 对于对象来说，除了函数都会显示 <code>object</code>，所以说 <code>typeof</code> 并不能准确判断变量到底是什么类型</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">typeof</span> <span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token comment">// 'object'</span>
<span class="token keyword">typeof</span> <span class="token punctuation">{</span><span class="token punctuation">}</span> <span class="token comment">// 'object'</span>
<span class="token keyword">typeof</span> console<span class="token punctuation">.</span>log <span class="token comment">// 'function'</span>
</code></pre></div><blockquote><p>如果我们想判断一个对象的正确类型，这时候可以考虑使用 <code>instanceof</code>，因为内部机制是通过原型链来判断的</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">const</span> <span class="token function-variable function">Person</span> <span class="token operator">=</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token keyword">const</span> p1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Person</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
p1 <span class="token keyword">instanceof</span> <span class="token class-name">Person</span> <span class="token comment">// true</span>

<span class="token keyword">var</span> str <span class="token operator">=</span> <span class="token string">'hello world'</span>
str <span class="token keyword">instanceof</span> <span class="token class-name">String</span> <span class="token comment">// false</span>

<span class="token keyword">var</span> str1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">String</span><span class="token punctuation">(</span><span class="token string">'hello world'</span><span class="token punctuation">)</span>
str1 <span class="token keyword">instanceof</span> <span class="token class-name">String</span> <span class="token comment">// true</span>
</code></pre></div><blockquote><p>对于原始类型来说，你想直接通过 <code>instanceof</code>来判断类型是不行的</p></blockquote> <h2 id="_2-类型转换"><a href="#_2-类型转换" class="header-anchor">#</a> 2 类型转换</h2> <blockquote><p>首先我们要知道，在 <code>JS</code> 中类型转换只有三种情况，分别是：</p></blockquote> <ul><li>转换为布尔值</li> <li>转换为数字</li> <li>转换为字符串</li></ul> <p><img src="https://poetries1.gitee.io/img-repo/2020/07/1.png" alt="img"></p> <p><strong>转Boolean</strong></p> <blockquote><p>在条件判断时，除了 <code>undefined</code>，<code>null</code>， <code>false</code>， <code>NaN</code>， <code>''</code>， <code>0</code>， <code>-0</code>，其他所有值都转为 <code>true</code>，包括所有对象</p></blockquote> <p><strong>对象转原始类型</strong></p> <blockquote><p>对象在转换类型的时候，会调用内置的 <code>[[ToPrimitive]]</code> 函数，对于该函数来说，算法逻辑一般来说如下</p></blockquote> <ul><li>如果已经是原始类型了，那就不需要转换了</li> <li>调用 <code>x.valueOf()</code>，如果转换为基础类型，就返回转换的值</li> <li>调用 <code>x.toString()</code>，如果转换为基础类型，就返回转换的值</li> <li>如果都没有返回原始类型，就会报错</li></ul> <blockquote><p>当然你也可以重写 <code>Symbol.toPrimitive</code>，该方法在转原始类型时调用优先级最高。</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token number">0</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token string">'1'</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">[</span>Symbol<span class="token punctuation">.</span>toPrimitive<span class="token punctuation">]</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token number">2</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
<span class="token number">1</span> <span class="token operator">+</span> a <span class="token comment">// =&gt; 3</span>
</code></pre></div><p><strong>四则运算符</strong></p> <blockquote><p>它有以下几个特点：</p></blockquote> <ul><li>运算中其中一方为字符串，那么就会把另一方也转换为字符串</li> <li>如果一方不是字符串或者数字，那么会将它转换为数字或者字符串</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token number">1</span> <span class="token operator">+</span> <span class="token string">'1'</span> <span class="token comment">// '11'</span>
<span class="token boolean">true</span> <span class="token operator">+</span> <span class="token boolean">true</span> <span class="token comment">// 2</span>
<span class="token number">4</span> <span class="token operator">+</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">2</span><span class="token punctuation">,</span><span class="token number">3</span><span class="token punctuation">]</span> <span class="token comment">// &quot;41,2,3&quot;</span>
</code></pre></div><ul><li>对于第一行代码来说，触发特点一，所以将数字 <code>1</code> 转换为字符串，得到结果 <code>'11'</code></li> <li>对于第二行代码来说，触发特点二，所以将 <code>true</code> 转为数字 <code>1</code></li> <li>对于第三行代码来说，触发特点二，所以将数组通过 <code>toString</code>转为字符串 <code>1,2,3</code>，得到结果 <code>41,2,3</code></li></ul> <blockquote><p>另外对于加法还需要注意这个表达式 <code>'a' + + 'b'</code></p></blockquote> <div class="language-text extra-class"><pre class="language-text"><code>'a' + + 'b' // -&gt; &quot;aNaN&quot;
</code></pre></div><ul><li>因为 <code>+ 'b'</code> 等于 <code>NaN</code>，所以结果为 <code>&quot;aNaN&quot;</code>，你可能也会在一些代码中看到过 <code>+ '1'</code>的形式来快速获取 <code>number</code> 类型。</li> <li>那么对于除了加法的运算符来说，只要其中一方是数字，那么另一方就会被转为数字</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token number">4</span> <span class="token operator">*</span> <span class="token string">'3'</span> <span class="token comment">// 12</span>
<span class="token number">4</span> <span class="token operator">*</span> <span class="token punctuation">[</span><span class="token punctuation">]</span> <span class="token comment">// 0</span>
<span class="token number">4</span> <span class="token operator">*</span> <span class="token punctuation">[</span><span class="token number">1</span><span class="token punctuation">,</span> <span class="token number">2</span><span class="token punctuation">]</span> <span class="token comment">// NaN</span>
</code></pre></div><p><strong>比较运算符</strong></p> <ul><li>如果是对象，就通过 <code>toPrimitive</code> 转换对象</li> <li>如果是字符串，就通过 <code>unicode</code> 字符索引来比较</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token punctuation">{</span>
  <span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token number">0</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token function">toString</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token string">'1'</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
a <span class="token operator">&gt;</span> <span class="token operator">-</span><span class="token number">1</span> <span class="token comment">// true</span>
</code></pre></div><blockquote><p>在以上代码中，因为 <code>a</code> 是对象，所以会通过 <code>valueOf</code> 转换为原始类型再比较值。</p></blockquote> <h2 id="_3-this"><a href="#_3-this" class="header-anchor">#</a> 3 This</h2> <blockquote><p>我们先来看几个函数调用的场景</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">function</span> <span class="token function">foo</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>a<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
<span class="token keyword">var</span> a <span class="token operator">=</span> <span class="token number">1</span>
<span class="token function">foo</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token keyword">const</span> obj <span class="token operator">=</span> <span class="token punctuation">{</span>
  a<span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
  foo<span class="token operator">:</span> foo
<span class="token punctuation">}</span>
obj<span class="token punctuation">.</span><span class="token function">foo</span><span class="token punctuation">(</span><span class="token punctuation">)</span>

<span class="token keyword">const</span> c <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">foo</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre></div><ul><li>对于直接调用 <code>foo</code> 来说，不管 <code>foo</code> 函数被放在了什么地方，<code>this</code> 一定是<code>window</code></li> <li>对于 <code>obj.foo()</code> 来说，我们只需要记住，谁调用了函数，谁就是 <code>this</code>，所以在这个场景下 <code>foo</code> 函数中的 <code>this</code> 就是 <code>obj</code> 对象</li> <li>对于 <code>new</code> 的方式来说，<code>this</code> 被永远绑定在了 <code>c</code> 上面，不会被任何方式改变 <code>this</code></li></ul> <blockquote><p>说完了以上几种情况，其实很多代码中的 <code>this</code> 应该就没什么问题了，下面让我们看看箭头函数中的 <code>this</code></p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">function</span> <span class="token function">a</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
      console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span>
    <span class="token punctuation">}</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token function">a</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
</code></pre></div><ul><li>首先箭头函数其实是没有 <code>this</code> 的，箭头函数中的 <code>this</code> 只取决包裹箭头函数的第一个普通函数的 <code>this</code>。在这个例子中，因为包裹箭头函数的第一个普通函数是 <code>a</code>，所以此时的 <code>this</code> 是 <code>window</code>。另外对箭头函数使用 <code>bind</code>这类函数是无效的。</li> <li>最后种情况也就是 <code>bind</code> 这些改变上下文的 <code>API</code> 了，对于这些函数来说，<code>this</code> 取决于第一个参数，如果第一个参数为空，那么就是 <code>window</code>。</li> <li>那么说到 <code>bind</code>，不知道大家是否考虑过，如果对一个函数进行多次 <code>bind</code>，那么上下文会是什么呢？</li></ul> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token punctuation">{</span><span class="token punctuation">}</span>
<span class="token keyword">let</span> <span class="token function-variable function">fn</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span> <span class="token punctuation">}</span>
<span class="token function">fn</span><span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// =&gt; ?</span>
</code></pre></div><blockquote><p>如果你认为输出结果是 <code>a</code>，那么你就错了，其实我们可以把上述代码转换成另一种形式</p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token comment">// fn.bind().bind(a) 等于</span>
<span class="token keyword">let</span> <span class="token function-variable function">fn2</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token function">fn1</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  <span class="token keyword">return</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token function">fn</span><span class="token punctuation">.</span><span class="token function">apply</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
  <span class="token punctuation">}</span><span class="token punctuation">.</span><span class="token function">apply</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
<span class="token function">fn2</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
</code></pre></div><blockquote><p>可以从上述代码中发现，不管我们给函数 <code>bind</code> 几次，<code>fn</code> 中的 <code>this</code> 永远由第一次 <code>bind</code> 决定，所以结果永远是 <code>window</code></p></blockquote> <div class="language-js extra-class"><pre class="language-js"><code><span class="token keyword">let</span> a <span class="token operator">=</span> <span class="token punctuation">{</span> name<span class="token operator">:</span> <span class="token string">'poetries'</span> <span class="token punctuation">}</span>
<span class="token keyword">function</span> <span class="token function">foo</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
  console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">.</span>name<span class="token punctuation">)</span>
<span class="token punctuation">}</span>
<span class="token function">foo</span><span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token comment">// =&gt; 'poetries'</span>
</code></pre></div><h2 id="_4-和-有什么区别"><a href="#_4-和-有什么区别" class="header-anchor">#</a> 4 == 和 === 有什么区别</h2> <h2 id="_5-闭包"><a href="#_5-闭包" class="header-anchor">#</a> 5 闭包</h2> <h2 id="_6-深浅拷贝"><a href="#_6-深浅拷贝" class="header-anchor">#</a> 6 深浅拷贝</h2> <h2 id="_7-原型"><a href="#_7-原型" class="header-anchor">#</a> 7 原型</h2> <h2 id="_8-var、let-及-const-区别"><a href="#_8-var、let-及-const-区别" class="header-anchor">#</a> 8 var、let 及 const 区别</h2> <h2 id="_9-原型继承和-class-继承"><a href="#_9-原型继承和-class-继承" class="header-anchor">#</a> 9 原型继承和 Class 继承</h2> <h2 id="_10-模块化"><a href="#_10-模块化" class="header-anchor">#</a> 10 模块化</h2> <h2 id="_11-实现一个简洁版的promise"><a href="#_11-实现一个简洁版的promise" class="header-anchor">#</a> 11 实现一个简洁版的promise</h2> <h2 id="_12-event-loop"><a href="#_12-event-loop" class="header-anchor">#</a> 12 Event Loop</h2> <h3 id="_12-1-进程与线程"><a href="#_12-1-进程与线程" class="header-anchor">#</a> 12.1 进程与线程</h3> <h3 id="_12-2-执行栈"><a href="#_12-2-执行栈" class="header-anchor">#</a> 12.2 执行栈</h3> <h3 id="_12-3-浏览器中的-event-loop"><a href="#_12-3-浏览器中的-event-loop" class="header-anchor">#</a> 12.3 浏览器中的 Event Loop</h3> <h3 id="_12-4-node-中的-event-loop"><a href="#_12-4-node-中的-event-loop" class="header-anchor">#</a> 12.4 Node 中的 Event loop</h3> <h2 id="_13-手写-call、apply-及-bind-函数"><a href="#_13-手写-call、apply-及-bind-函数" class="header-anchor">#</a> 13 手写 call、apply 及 bind 函数</h2> <h2 id="_14-new"><a href="#_14-new" class="header-anchor">#</a> 14 new</h2> <h2 id="_15-instanceof-的原理"><a href="#_15-instanceof-的原理" class="header-anchor">#</a> 15 instanceof 的原理</h2> <h2 id="_16-为什么-0-1-0-2-0-3"><a href="#_16-为什么-0-1-0-2-0-3" class="header-anchor">#</a> 16 为什么 0.1 + 0.2 != 0.3</h2> <h2 id="_17-事件机制"><a href="#_17-事件机制" class="header-anchor">#</a> 17 事件机制</h2> <h3 id="_17-1-事件触发三阶段"><a href="#_17-1-事件触发三阶段" class="header-anchor">#</a> 17.1 事件触发三阶段</h3> <h3 id="_17-2-注册事件"><a href="#_17-2-注册事件" class="header-anchor">#</a> 17.2 注册事件</h3> <h3 id="_17-3-事件代理"><a href="#_17-3-事件代理" class="header-anchor">#</a> 17.3 事件代理</h3> <h2 id="_18-跨域"><a href="#_18-跨域" class="header-anchor">#</a> 18 跨域</h2> <h3 id="_18-1-jsonp"><a href="#_18-1-jsonp" class="header-anchor">#</a> 18.1 JSONP</h3> <h3 id="_18-2-cors"><a href="#_18-2-cors" class="header-anchor">#</a> 18.2 CORS</h3> <h3 id="_18-3-document-domain"><a href="#_18-3-document-domain" class="header-anchor">#</a> 18.3 document.domain</h3> <h3 id="_18-4-postmessage"><a href="#_18-4-postmessage" class="header-anchor">#</a> 18.4 postMessage</h3> <h2 id="_19-存储"><a href="#_19-存储" class="header-anchor">#</a> 19 存储</h2> <h2 id="_20-浏览器缓存机制"><a href="#_20-浏览器缓存机制" class="header-anchor">#</a> 20 浏览器缓存机制</h2> <h3 id="_20-1-缓存位置"><a href="#_20-1-缓存位置" class="header-anchor">#</a> 20.1 缓存位置</h3> <h3 id="_20-2-缓存策略"><a href="#_20-2-缓存策略" class="header-anchor">#</a> 20.2 缓存策略</h3> <h3 id="_20-2-1-强缓存"><a href="#_20-2-1-强缓存" class="header-anchor">#</a> 20.2.1 强缓存</h3> <h3 id="_20-2-2-协商缓存"><a href="#_20-2-2-协商缓存" class="header-anchor">#</a> 20.2.2 协商缓存</h3> <h3 id="_20-3-实际场景应用缓存策略"><a href="#_20-3-实际场景应用缓存策略" class="header-anchor">#</a> 20.3 实际场景应用缓存策略</h3> <h2 id="_21-浏览器渲染原理"><a href="#_21-浏览器渲染原理" class="header-anchor">#</a> 21 浏览器渲染原理</h2> <h3 id="_21-1-渲染过程"><a href="#_21-1-渲染过程" class="header-anchor">#</a> 21.1 渲染过程</h3> <h3 id="_21-2-为什么操作-dom-慢"><a href="#_21-2-为什么操作-dom-慢" class="header-anchor">#</a> 21.2 为什么操作 DOM 慢</h3> <h3 id="_21-3-什么情况阻塞渲染"><a href="#_21-3-什么情况阻塞渲染" class="header-anchor">#</a> 21.3 什么情况阻塞渲染</h3> <h3 id="_21-4-重绘-repaint-和回流-reflow"><a href="#_21-4-重绘-repaint-和回流-reflow" class="header-anchor">#</a> 21.4 重绘（Repaint）和回流（Reflow）</h3> <h3 id="_21-5-减少重绘和回流"><a href="#_21-5-减少重绘和回流" class="header-anchor">#</a> 21.5 减少重绘和回流</h3> <h2 id="_22-安全防范"><a href="#_22-安全防范" class="header-anchor">#</a> 22 安全防范</h2> <h3 id="_22-1-xss"><a href="#_22-1-xss" class="header-anchor">#</a> 22.1 XSS</h3> <h3 id="_22-2-csrf"><a href="#_22-2-csrf" class="header-anchor">#</a> 22.2 CSRF</h3> <h3 id="_22-3-点击劫持"><a href="#_22-3-点击劫持" class="header-anchor">#</a> 22.3 点击劫持</h3> <h2 id="_23-从-v8-中看-js-性能优化"><a href="#_23-从-v8-中看-js-性能优化" class="header-anchor">#</a> 23 从 V8 中看 JS 性能优化</h2> <h3 id="_23-1-测试性能工具"><a href="#_23-1-测试性能工具" class="header-anchor">#</a> 23.1 测试性能工具</h3> <h3 id="_23-2-js-性能优化"><a href="#_23-2-js-性能优化" class="header-anchor">#</a> 23.2 JS 性能优化</h3> <h2 id="_24-性能优化"><a href="#_24-性能优化" class="header-anchor">#</a> 24 性能优化</h2> <h3 id="_24-1-图片优化"><a href="#_24-1-图片优化" class="header-anchor">#</a> 24.1 图片优化</h3> <h3 id="_24-2-图片加载优化"><a href="#_24-2-图片加载优化" class="header-anchor">#</a> 24.2 图片加载优化</h3> <h3 id="_24-3-dns-预解析"><a href="#_24-3-dns-预解析" class="header-anchor">#</a> 24.3 DNS 预解析</h3> <h3 id="_24-4-节流"><a href="#_24-4-节流" class="header-anchor">#</a> 24.4 节流</h3> <h3 id="_24-5-防抖"><a href="#_24-5-防抖" class="header-anchor">#</a> 24.5 防抖</h3> <h3 id="_24-6-预加载"><a href="#_24-6-预加载" class="header-anchor">#</a> 24.6 预加载</h3> <h3 id="_24-7-预渲染"><a href="#_24-7-预渲染" class="header-anchor">#</a> 24.7 预渲染</h3> <h3 id="_24-8-懒执行"><a href="#_24-8-懒执行" class="header-anchor">#</a> 24.8 懒执行</h3> <h3 id="_24-9-懒加载"><a href="#_24-9-懒加载" class="header-anchor">#</a> 24.9 懒加载</h3> <h3 id="_24-10-cdn"><a href="#_24-10-cdn" class="header-anchor">#</a> 24.10 CDN</h3> <h2 id="_25-webpack-性能优化"><a href="#_25-webpack-性能优化" class="header-anchor">#</a> 25 Webpack 性能优化</h2> <h3 id="_25-1-减少-webpack-打包时间"><a href="#_25-1-减少-webpack-打包时间" class="header-anchor">#</a> 25.1 减少 Webpack 打包时间</h3> <h3 id="_25-2-减少-webpack-打包后的文件体积"><a href="#_25-2-减少-webpack-打包后的文件体积" class="header-anchor">#</a> 25.2 减少 Webpack 打包后的文件体积</h3> <h2 id="_26-实现小型打包工具"><a href="#_26-实现小型打包工具" class="header-anchor">#</a> 26 实现小型打包工具</h2> <h2 id="_27-mvvm-虚拟dom-前端路由"><a href="#_27-mvvm-虚拟dom-前端路由" class="header-anchor">#</a> 27 MVVM/虚拟DOM/前端路由</h2> <h3 id="_27-1-mvvm"><a href="#_27-1-mvvm" class="header-anchor">#</a> 27.1 MVVM</h3> <h3 id="_27-2-virtual-dom"><a href="#_27-2-virtual-dom" class="header-anchor">#</a> 27.2 Virtual DOM</h3> <h3 id="_27-3-路由原理"><a href="#_27-3-路由原理" class="header-anchor">#</a> 27.3 路由原理</h3> <h3 id="_27-4-vue-和-react-之间的区别"><a href="#_27-4-vue-和-react-之间的区别" class="header-anchor">#</a> 27.4 Vue 和 React 之间的区别</h3> <h2 id="_28-vue常考知识点"><a href="#_28-vue常考知识点" class="header-anchor">#</a> 28 Vue常考知识点</h2> <h3 id="_28-1-生命周期钩子函数"><a href="#_28-1-生命周期钩子函数" class="header-anchor">#</a> 28.1 生命周期钩子函数</h3> <h3 id="_28-2-组件通信"><a href="#_28-2-组件通信" class="header-anchor">#</a> 28.2 组件通信</h3> <h3 id="_28-3-extend-能做什么"><a href="#_28-3-extend-能做什么" class="header-anchor">#</a> 28.3 extend 能做什么</h3> <h3 id="_28-4-mixin-和-mixins-区别"><a href="#_28-4-mixin-和-mixins-区别" class="header-anchor">#</a> 28.4 mixin 和 mixins 区别</h3> <h3 id="_28-5-computed-和-watch-区别"><a href="#_28-5-computed-和-watch-区别" class="header-anchor">#</a> 28.5 computed 和 watch 区别</h3> <h3 id="_28-6-keep-alive-组件有什么作用"><a href="#_28-6-keep-alive-组件有什么作用" class="header-anchor">#</a> 28.6 keep-alive 组件有什么作用</h3> <h3 id="_28-7-v-show-与-v-if-区别"><a href="#_28-7-v-show-与-v-if-区别" class="header-anchor">#</a> 28.7 v-show 与 v-if 区别</h3> <h3 id="_28-8-组件中-data-什么时候可以使用对象"><a href="#_28-8-组件中-data-什么时候可以使用对象" class="header-anchor">#</a> 28.8 组件中 data 什么时候可以使用对象</h3> <h3 id="_28-9-响应式原理"><a href="#_28-9-响应式原理" class="header-anchor">#</a> 28.9 响应式原理</h3> <h4 id="_28-9-1-object-defineproperty-的缺陷"><a href="#_28-9-1-object-defineproperty-的缺陷" class="header-anchor">#</a> 28.9.1 Object.defineProperty 的缺陷</h4> <h4 id="_28-9-2-编译过程"><a href="#_28-9-2-编译过程" class="header-anchor">#</a> 28.9.2 编译过程</h4> <h4 id="_28-9-3-nexttick-原理分析"><a href="#_28-9-3-nexttick-原理分析" class="header-anchor">#</a> 28.9.3 NextTick 原理分析</h4> <h2 id="_29-react常考知识点"><a href="#_29-react常考知识点" class="header-anchor">#</a> 29 React常考知识点</h2> <h3 id="_29-1-生命周期"><a href="#_29-1-生命周期" class="header-anchor">#</a> 29.1 生命周期</h3> <h3 id="_29-2-setstate"><a href="#_29-2-setstate" class="header-anchor">#</a> 29.2 setState</h3> <h3 id="_29-3-性能优化"><a href="#_29-3-性能优化" class="header-anchor">#</a> 29.3 性能优化</h3> <h3 id="_29-4-通信"><a href="#_29-4-通信" class="header-anchor">#</a> 29.4 通信</h3> <h3 id="_29-5-hoc-是什么-相比-mixins-有什么优点"><a href="#_29-5-hoc-是什么-相比-mixins-有什么优点" class="header-anchor">#</a> 29.5 HOC 是什么？相比 mixins 有什么优点？</h3> <h3 id="_29-6-事件机制"><a href="#_29-6-事件机制" class="header-anchor">#</a> 29.6 事件机制</h3> <h2 id="_30-监控"><a href="#_30-监控" class="header-anchor">#</a> 30 监控</h2> <h2 id="_30-1-页面埋点"><a href="#_30-1-页面埋点" class="header-anchor">#</a> 30.1 页面埋点</h2> <h2 id="_30-2-性能监控"><a href="#_30-2-性能监控" class="header-anchor">#</a> 30.2 性能监控</h2> <h2 id="_30-3-异常监控"><a href="#_30-3-异常监控" class="header-anchor">#</a> 30.3 异常监控</h2> <h2 id="_31-tcp-udp"><a href="#_31-tcp-udp" class="header-anchor">#</a> 31 TCP/UDP</h2> <h3 id="_31-1-udp"><a href="#_31-1-udp" class="header-anchor">#</a> 31.1 UDP</h3> <h3 id="_31-2-tcp"><a href="#_31-2-tcp" class="header-anchor">#</a> 31.2 TCP</h3> <h2 id="_32-http-tls"><a href="#_32-http-tls" class="header-anchor">#</a> 32 HTTP/TLS</h2> <h3 id="_32-1-http-请求中的内容"><a href="#_32-1-http-请求中的内容" class="header-anchor">#</a> 32.1 HTTP 请求中的内容</h3> <h3 id="_32-2-tls"><a href="#_32-2-tls" class="header-anchor">#</a> 32.2 TLS</h3> <h2 id="_33-http2-0"><a href="#_33-http2-0" class="header-anchor">#</a> 33 HTTP2.0</h2> <h3 id="_33-1-http-2"><a href="#_33-1-http-2" class="header-anchor">#</a> 33.1 HTTP/2</h3> <h3 id="_33-2-二进制传输"><a href="#_33-2-二进制传输" class="header-anchor">#</a> 33.2 二进制传输</h3> <h3 id="_33-3-多路复用"><a href="#_33-3-多路复用" class="header-anchor">#</a> 33.3 多路复用</h3> <h3 id="_33-4-header-压缩"><a href="#_33-4-header-压缩" class="header-anchor">#</a> 33.4 Header 压缩</h3> <h3 id="_33-5-服务端-push"><a href="#_33-5-服务端-push" class="header-anchor">#</a> 33.5 服务端 Push</h3> <h3 id="_33-6-http-3"><a href="#_33-6-http-3" class="header-anchor">#</a> 33.6 HTTP/3</h3> <h2 id="_34-设计模式"><a href="#_34-设计模式" class="header-anchor">#</a> 34 设计模式</h2> <h3 id="_34-1-工厂模式"><a href="#_34-1-工厂模式" class="header-anchor">#</a> 34.1 工厂模式</h3> <h3 id="_34-2-单例模式"><a href="#_34-2-单例模式" class="header-anchor">#</a> 34.2 单例模式</h3> <h3 id="_34-3-适配器模式"><a href="#_34-3-适配器模式" class="header-anchor">#</a> 34.3 适配器模式</h3> <h3 id="_34-4-装饰模式"><a href="#_34-4-装饰模式" class="header-anchor">#</a> 34.4 装饰模式</h3> <h3 id="_34-5-代理模式"><a href="#_34-5-代理模式" class="header-anchor">#</a> 34.5 代理模式</h3> <h3 id="_34-6-发布-订阅模式"><a href="#_34-6-发布-订阅模式" class="header-anchor">#</a> 34.6 发布-订阅模式</h3> <h3 id="_34-7-外观模式"><a href="#_34-7-外观模式" class="header-anchor">#</a> 34.7 外观模式</h3> <h2 id="_35-常见数据结构"><a href="#_35-常见数据结构" class="header-anchor">#</a> 35 常见数据结构</h2> <h3 id="_35-1-时间复杂度"><a href="#_35-1-时间复杂度" class="header-anchor">#</a> 35.1 时间复杂度</h3> <h3 id="_35-2-栈"><a href="#_35-2-栈" class="header-anchor">#</a> 35.2 栈</h3> <h3 id="_35-3-应用"><a href="#_35-3-应用" class="header-anchor">#</a> 35.3 应用</h3> <h3 id="_35-4-队列"><a href="#_35-4-队列" class="header-anchor">#</a> 35.4 队列</h3> <h3 id="_35-5-链表"><a href="#_35-5-链表" class="header-anchor">#</a> 35.5 链表</h3> <h3 id="_35-6-树"><a href="#_35-6-树" class="header-anchor">#</a> 35.6 树</h3> <h3 id="_35-7-avl-树"><a href="#_35-7-avl-树" class="header-anchor">#</a> 35.7 AVL 树</h3> <h3 id="_35-8-trie"><a href="#_35-8-trie" class="header-anchor">#</a> 35.8 Trie</h3> <h3 id="_35-9-并查集"><a href="#_35-9-并查集" class="header-anchor">#</a> 35.9 并查集</h3> <h3 id="_35-10-堆"><a href="#_35-10-堆" class="header-anchor">#</a> 35.10 堆</h3> <h2 id="_36-常考算法题解析"><a href="#_36-常考算法题解析" class="header-anchor">#</a> 36 常考算法题解析</h2> <h3 id="_36-1-位运算"><a href="#_36-1-位运算" class="header-anchor">#</a> 36.1 位运算</h3> <h3 id="_36-2-排序"><a href="#_36-2-排序" class="header-anchor">#</a> 36.2 排序</h3> <h4 id="_36-2-1-冒泡排序"><a href="#_36-2-1-冒泡排序" class="header-anchor">#</a> 36.2.1 冒泡排序</h4> <h4 id="_36-2-2-插入排序"><a href="#_36-2-2-插入排序" class="header-anchor">#</a> 36.2.2 插入排序</h4> <h4 id="_36-2-3-选择排序"><a href="#_36-2-3-选择排序" class="header-anchor">#</a> 36.2.3 选择排序</h4> <h4 id="_36-2-4-归并排序"><a href="#_36-2-4-归并排序" class="header-anchor">#</a> 36.2.4 归并排序</h4> <h4 id="_36-2-5-快排"><a href="#_36-2-5-快排" class="header-anchor">#</a> 36.2.5 快排</h4> <h4 id="_36-2-6-堆排序"><a href="#_36-2-6-堆排序" class="header-anchor">#</a> 36.2.6 堆排序</h4> <h3 id="_36-3-链表"><a href="#_36-3-链表" class="header-anchor">#</a> 36.3 链表</h3> <h3 id="_36-4-树"><a href="#_36-4-树" class="header-anchor">#</a> 36.4 树</h3> <h3 id="_36-5-动态规划"><a href="#_36-5-动态规划" class="header-anchor">#</a> 36.5 动态规划</h3> <h2 id="_37-css常考面试题解析"><a href="#_37-css常考面试题解析" class="header-anchor">#</a> 37 css常考面试题解析</h2></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">更新时间:</span> <span class="time">11/1/2021, 10:50:11 AM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/technology/" class="prev router-link-active">
        待整理部分
      </a></span> <span class="next"><a href="/technology/js_higher.html">
        JS高级知识点
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.bf44e39b.js" defer></script><script src="/assets/js/2.db7a59af.js" defer></script><script src="/assets/js/268.2bdd86cb.js" defer></script>
  </body>
</html>
